package theThirdWay_Peterson;

import java.util.ArrayList;
import java.util.Stack;

public class MainClass {
    public static Stack stack = new Stack();
    public static volatile ArrayList<Boolean> flag = new ArrayList<>();
    public static volatile int turn;

    public static void main(String[] args) {
        //flag的初始化
        flag.add(0,false);
        flag.add(1,false);
        ThreadPush3 threadPush = new ThreadPush3();
        ThreadPop3 threadPop = new ThreadPop3();
        Thread t1 = new Thread(threadPush, "Push");
        Thread t2 = new Thread(threadPop, "Pop");
        t1.start();
        t2.start();
    }
}
